<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>QQ音乐排行榜</title>
    <!-- <link rel="stylesheet" href="./css/reset.css" /> -->
    <style>
      body {
        margin: 0;
        padding: 0;
      }

      a {
        text-decoration: none;
      }

      .music-top {
        width: 800px;
        /* height: 600px;
        border: 2px solid red; */

        margin: 50px auto 0px;
      }

      .music-top h1 {
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 40px;
        color: #010101;
        text-align: center;
      }

      .music-top table {
        width: 100%;
        /* border: 2px solid red; */
        border-spacing: 0;
        border-collapse: collapse;
        margin-top: 28px;
      }

      .music-top table tr th {
        /* border: 1px solid #fff; */
        color: #fff;
        background-color: #31c272;
        text-align: left;
        height: 80px;
        line-height: 80px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 18px;
        color: #ffffff;
      }

      .music-top table tr td {
        /* border: 1px solid #000; */
        height: 80px;
        /* line-height: 80px; */
      }

      .music-top table tr:nth-of-type(odd) {
        background-color: #fff;
      }

      .music-top table tr:nth-of-type(even) {
        background-color: #f7f7f7;
      }

      .col1 {
        width: 60px;
      }

      .col2 {
        width: 80px;
      }

      /* .col3 {
      } */

      .col4 {
        width: 120px;
      }
      .col5 {
        width: 80px;
      }

      .music-top table tr td:nth-child(1) {
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 20px;
        color: #010101;
        text-align: center;
      }

      .music-top table tr td.top {
        color: #f00;
      }

      table tr td:nth-child(2) img {
        display: block;
        margin-left: 10px;
      }

      table tr td:nth-child(2) {
        font-family: Microsoft YaHei;
        font-weight: 400;
        font-size: 12px;
        color: #999;
      }

      table tr td:nth-child(3) {
        font-family: Microsoft YaHei;
        font-weight: 300;
        font-size: 14px;
        color: #999;
      }

      table tr td:nth-child(3) .con {
        height: 60px;
        position: relative;
      }

      table tr td:nth-child(3) .con a {
        color: #999;
      }

      table tr td:nth-child(3) .con .text {
        position: absolute;
        height: 60px;
        line-height: 60px;
        top: 0;
        left: 79px;
        /* 自适应宽度 */
        right: 0px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }

      table tr td:nth-child(3) .con .controls {
        width: 140px;
        height: 36px;
        /* border: 1px solid #000; */
        position: absolute;
        top: 12px;
        right: 0;
        display: none;
      }

      table tr td:nth-child(3) .con .controls i {
        width: 36px;
        height: 36px;
        display: inline-block;
        background: url(./images/icon-music.png);
      }

      table tr td:nth-child(3) .con .controls i.play {
        background-position: 0 0;
      }

      table tr td:nth-child(3) .con .controls i.add {
        background-position: 0 -80px;
      }

      table tr td:nth-child(3) .con .controls i.shared {
        background-position: 0 -40px;
      }

      table tr td:nth-child(3) .con .controls i.play:hover {
        background-position: -40px 0;
      }

      table tr td:nth-child(3) .con .controls i.add:hover {
        background-position: -40px -80px;
      }

      table tr td:nth-child(3) .con .controls i.shared:hover {
        background-position: -40px -40px;
      }

      /* table tr td:nth-child(3) .con:hover .text { */
      table tr:hover td:nth-child(3) .con .text {
        right: 150px;
      }

      table tr:hover td:nth-child(3) .con .controls {
        display: block;
      }

      table tr td:nth-child(3) img {
        width: 60px;
        /* margin: 10px 19px 10px 0; */
        /* float: left; */
      }

      table tr td:nth-child(3) span {
        color: #000;
      }

      table tr:hover td:nth-child(3) span {
        color: #31c272;
      }

      table tr td:nth-child(4),
      table tr td:nth-child(5) {
        font-family: Microsoft YaHei;
        font-weight: 300;
        font-size: 12px;
        color: #999;
      }
    </style>
  </head>
  <body>
    <div class="music-top">
      <h1>QQ音乐排行榜</h1>
      <table>
        <colgroup>
          <!--单独控制每一列的样式-->
          <col span="1" class="col1" />
          <col span="1" class="col2" />
          <col span="1" class="col3" />
          <col span="1" class="col4" />
          <col span="1" class="col5" />
        </colgroup>
        <tr>
          <th></th>
          <th>排行</th>
          <th>歌曲</th>
          <th>歌手</th>
          <th>时长</th>
        </tr>
        <tr>
          <td class="top">1</td>
          <td>
            <img src="./images/up-jiantou.png" alt="arrow-up" />
            158%
          </td>
          <td>
            <div class="con">
              <a href="#"><img src="./images/music-img1.webp" alt="music-image" /></a>
              <div class="text">
                <a href="#">
                  <span>爱丫爱丫</span>
                  《爱情是从告白开始的》电视剧插曲
                </a>
              </div>
              <div class="controls">
                <i class="play"></i>
                <i class="add"></i>
                <i class="shared"></i>
              </div>
            </div>
          </td>
          <td>BY2</td>
          <td>03:51</td>
        </tr>
        <tr>
          <td class="top">2</td>
          <td>
            <img src="./images/up-jiantou.png" alt="arrow-up" />
            128%
          </td>
          <td>
            <div class="con">
              <a href="#"><img src="./images/music-img2.webp" alt="music-image" /></a>
              <div class="text">
                <a href="#">
                  <span>春泥 (女版)</span>
                  《爱情是从告白开始的》电视剧插曲
                </a>
              </div>
              <div class="controls">
                <i class="play"></i>
                <i class="add"></i>
                <i class="shared"></i>
              </div>
            </div>
          </td>
          <td>旺仔小乔</td>
          <td>03:51</td>
        </tr>
        <tr>
          <td class="top">3</td>
          <td>
            <img src="./images/up-jiantou.png" alt="arrow-up" />
            90%
          </td>
          <td>
            <div class="con">
              <a href="#"><img src="./images/music-img3.webp" alt="music-image" /></a>
              <div class="text">
                <a href="#">
                  <span>孤勇者(Live)</span>
                  《英雄联盟：双城》电视剧插曲
                </a>
              </div>
              <div class="controls">
                <i class="play"></i>
                <i class="add"></i>
                <i class="shared"></i>
              </div>
            </div>
          </td>
          <td>永彬Ryan.B</td>
          <td>03:14</td>
        </tr>
        <tr>
          <td>4</td>
          <td>
            <img src="./images/up-jiantou.png" alt="arrow-up" />
            88%
          </td>
          <td>
            <div class="con">
              <a href="#"><img src="./images/music-img4.webp" alt="music-image" /></a>
              <div class="text">
                <a href="#">
                  <span>最幸运的幸运(Live)</span>
                  《余生，请多指教》电视剧片尾曲
                </a>
              </div>
              <div class="controls">
                <i class="play"></i>
                <i class="add"></i>
                <i class="shared"></i>
              </div>
            </div>
          </td>
          <td>张韶涵 /信</td>
          <td>04:30</td>
        </tr>
        <tr>
          <td>5</td>
          <td>
            <img src="./images/up-jiantou.png" alt="arrow-up" />
            79%
          </td>
          <td>
            <div class="con">
              <a href="#"><img src="./images/music-img5.webp" alt="music-image" /></a>
              <div class="text">
                <a href="#">
                  <span>鲛人之歌(Live)</span>
                  《与君初相识》电视剧片尾曲 4 5
                </a>
              </div>
              <div class="controls">
                <i class="play"></i>
                <i class="add"></i>
                <i class="shared"></i>
              </div>
            </div>
          </td>
          <td>BY2</td>
          <td>03:51</td>
        </tr>
      </table>
    </div>
  </body>
</html>
